/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package utils;

import org.jdesktop.application.Task;
import org.jdesktop.application.Task.InputBlocker;

/**
 *
 * @author hnmtuan
 */
public class BusyIndicatorInputBlocker extends InputBlocker {

    private BusyIndicator localBusyIndicator;

    public BusyIndicatorInputBlocker(Task task, BusyIndicator busyIndicator) {
            super(task, Task.BlockingScope.WINDOW, busyIndicator);
            localBusyIndicator = busyIndicator;
        }

    @Override
    protected void block() {
        localBusyIndicator.start();
    }

    @Override
    protected void unblock() {
        localBusyIndicator.stop();
    }

}
